package com.apps.sannotation.service;

import com.apps.sannotation.service.enums.SingleThreadPattern;

import java.lang.annotation.*;

/**
 * 对服务类开启或关闭单线程锁
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface OnSingleThread {

    //模式,默认对数据库插入和更新都改成单线程模式
    SingleThreadPattern pattern() default SingleThreadPattern.Save;

}
